home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
comm
/
mail
/
AEMail230.lha
/
aemail230
/
arexx
/
GrptoList.aem
< prev
next >
Wrap
Text File
|
1999-03-07
|
2KB
|
82 lines
/* AEMail Create List from Address Book Group */
OPTIONS RESULTS
/* TRACE ALL */
GETFILENAME "'Enter File of Email Addresses'"
filenm = RESULT
IF (OPEN('listfile', filenm, 'W') = 0) THEN DO
OKAY1 "Invalid File; Aborting ..."
EXIT
END
ADDTOAB = 1
IF (ADDTOAB = 1) THEN DO
OK = 0
DO UNTIL OK = 1
ADDRESS_BOOK LIST GROUP DESCRIPTION LF
grplist = RESULT
GETLISTITEM "'"grplist"' 'Select the Group Wanted'"
grpname = RESULT
IF (grpname = "") THEN DO
OKAY1 '"No Group Selected; Aborting ..."'
EXIT
END
PARSE VAR grpname grpname dflt
dflt = STRIP(dflt, 'L')
ADDRESS_BOOK GET grpname TYPE
addrtype = RESULT
IF (addrtype = -1) THEN DO
OKAY1 '"Group does not exist; Aborting ..."'
EXIT
END
IF (addrtype = 0) THEN DO
OKAY1 '"Re-enter Name|Cancel"' "Nickname is already used for an Individual"
IF (RESULT = 1) THEN OK = 0
IF (RESULT = 0) THEN exit
END
IF (addrtype = 1) THEN OK = 1
END
END
ADDRESS_BOOK GET grpname FIRST USERID
name1 = RESULT
IF (name1 = "") THEN EXIT
emailaddr=RESULT
ADDRESS_BOOK GET "'"name1"'" TYPE
IF (RESULT = 0) THEN DO
ADDRESS_BOOK GET "'"name1"'" USERID
emailaddr=RESULT
END
DO UNTIL emailaddr = ""
WRITELN('listfile', emailaddr)
ADDRESS_BOOK GET grpname NEXT USERID
IF (RC ~= 0) THEN DO
OKAY1 "last error is "AEMAIL.LASTERROR
EXIT
END
name1 = RESULT
IF (name1 = "") THEN LEAVE
emailaddr=RESULT
ADDRESS_BOOK GET "'"name1"'" TYPE
IF (RESULT = 0) THEN DO
ADDRESS_BOOK GET "'"name1"'" USERID
emailaddr=RESULT
END
END
CLOSE('listfile')
OKAY1 "Last Email Address Written"